﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Data;
using QLKS.Templates;

namespace QLKS.Views
{
    /// <summary>
    /// Interaction logic for frmBCMatDoSuDungPhong.xaml
    /// </summary>
    public partial class frmBCMatDoSuDungPhong : FormTrans
    {
        int nam = 0;
        int ky = 0;
        public frmBCMatDoSuDungPhong(int nam, int ky)
        {
            InitializeComponent();
            this.nam = nam;
            this.ky = ky;
        }

        private void FormTrans_Loaded(object sender, RoutedEventArgs e)
        {
            mainContent.StringBrowse = "maphong:Mã phòng:150;songay:Số ngày thuê:150;tyle:Tỷ lệ:100";
            mainContent.TableSource = ViewModels.BaoCaoViewModel.GetBaoCaoMatDoSuDungPhong(nam, ky);
            mainContent.F5 += new ucDmTemplate.GridKeyUp_F5(PressKey_F5);//Chi Tiết
        }

        void PressKey_F5(object sender, EventArgs e)
        {
            DataTable tb = mainContent.CurentRow;
            if (tb == null)
                return;
            (new frmBCChiTietMatDoSuDungPhong(nam, ky, tb.Rows[0]["maphong"].ToString())).Show();
        }
    }
}
